package filedemo2;

public class FileUtilDemo {
    public static void main(String[] args) {
        showDir(1, new java.io.File("D:\\Download"));
    }

    static void showDir(int indent, java.io.File file) {
        for (int i = 0; i < indent; i++)
            System.out.print('-');
        System.out.println(file.getName());
        if (file.isDirectory()) {
            java.io.File[] files = file.listFiles();
            for (int i = 0; i < files.length; i++)
                showDir(indent + 4, files[i]);
        }
    }
}
